package com.pansky.crm.common.mybatisplus;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.CollectionUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class SuperServiceImpl<M extends SuperMapper<T>, T> extends ServiceImpl<M, T> implements SuperService<T> {
    public SuperServiceImpl() {
    }

    public Map<String, T> getMapByIds(List<String> ids) {
        return (Map)(CollectionUtils.isEmpty(ids) ? new HashMap() : this.getMap((Wrapper)(new QueryWrapper()).in("id", ids)));
    }
}

